﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StreamReader和StreamWriter的简单使用
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //string path = @"D:\test\config\config.txt";
            //StreamReader streamReader = new StreamReader(path);

            //streamReader = new StreamReader(path, Encoding.UTF8);

            //FileStream fileStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read);   
            //streamReader = new StreamReader(fileStream);

            //streamReader = new StreamReader(fileStream, Encoding.UTF8);

            string path = @"D:\test\config\config.txt";
            StreamWriter streamWriter = new StreamWriter(path);

            streamWriter = new StreamWriter(path, true) ;

            FileStream fileStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read);
            streamWriter = new StreamWriter(fileStream);

            streamWriter = new StreamWriter(fileStream, Encoding.UTF8);
        }
    }
}
